// Copyright (C) Kumo inc. and its affiliates.
// Author: Jeff.li lijippy@163.com
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//
#pragma once

#include <gtest/gtest.h>

#include <pollux/common/file/file_systems.h>

#include <pollux/testing/common/faulty_file_system.h>
#include <pollux/testing/exec/memory_arbitration_fuzzer.h>
#include <pollux/functions/prestosql/aggregates/register_aggregate_functions.h>
#include <pollux/functions/prestosql/registration/registration_functions.h>
#include <pollux/serializers/presto_serializer.h>

namespace kumo::pollux::exec::test {

class MemoryArbitrationFuzzerRunner {
 public:
  static int run(size_t seed) {
    serializer::presto::PrestoVectorSerde::registerVectorSerde();
    filesystems::registerLocalFileSystem();
    tests::utils::registerFaultyFileSystem();
    functions::prestosql::registerAllScalarFunctions();
    aggregate::prestosql::registerAllAggregateFunctions();
    memoryArbitrationFuzzer(seed);
    return RUN_ALL_TESTS();
  }
};

} // namespace kumo::pollux::exec::test
